package com.bandapp.adapters;

import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bandapp.rss.TwitterRSSItem;
import com.bandapp.ui.R;


public class TwitterFeedAdapter extends ArrayAdapter<TwitterRSSItem> {

	private Bitmap image;
	
	
	public TwitterFeedAdapter(Context context, int textViewResourceId, List<TwitterRSSItem> objects, Bitmap bmp) {
		super(context, textViewResourceId,objects);
		image = bmp;
	}


	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View row;		
		
		if (null == convertView) {
			LayoutInflater mInflater = (LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			row = mInflater.inflate(R.layout.custom_row_feed, null);
		} else {
			row = convertView;
		}
 
		TextView tv = (TextView) row.findViewById(R.id.text);		
		TwitterRSSItem item = super.getItem(position);
		tv.setText(item.getDescription()); 
		/*
		ImageView imgView = (ImageView) row.findViewById(R.id.icon);
		imgView.setImageBitmap(image);
		*/
		return row;
	}

	

}
